package com.yang.myoschina.api.remote;

import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestParams;
import com.yang.myoschina.api.ApiHttpClient;

/**
 * Created by yangjianquan on 2016/11/4.
 */

public class OsChina {
    /**
     * 获取新闻列表
     * @param catalog 类别
     * @param page 页数
     * @param responseHandler
     */
    public static void getNewsList(int catalog, int page, AsyncHttpResponseHandler responseHandler){
        RequestParams params = new RequestParams();
        params.put("catalog", catalog);
        params.put("pageIndex", page);
        params.put("pageSize", 20);
        ApiHttpClient.get("action/api/news_list",params,responseHandler);
    }

    public static void getNewsDetail(String id,AsyncHttpResponseHandler handler){
        RequestParams params = new RequestParams("id",id);
        ApiHttpClient.get("action/api/news_detail",params,handler);
    }
}
